* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    width: 400px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 15px;
    color: #333;
}

.container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: #4a76a8;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
    font-weight: bold;
}

.settings-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.main-content {
    padding: 20px;
}

.input-section {
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-size: 14px;
    margin-bottom: 10px;
}

.language-selectors {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    width: 45%;
}

.swap-btn {
    background: #4a76a8;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.translate-btn {
    background: #4a76a8;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}

.translate-btn:hover {
    background: #3a6698;
}

.result-section {
    margin-top: 20px;
}

.result-box {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    min-height: 80px;
}

.result-placeholder {
    color: #888;
    text-align: center;
    padding: 20px 0;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.history-section {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-title {
    font-size: 14px;
    font-weight: bold;
}

.clear-history-btn {
    background: none;
    border: none;
    color: #4a76a8;
    cursor: pointer;
    font-size: 12px;
}

.history-list {
    max-height: 150px;
    overflow-y: auto;
}

.history-item {
    padding: 8px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 13px;
    cursor: pointer;
}

.history-item:hover {
    background: #f9f9f9;
}

.history-empty {
    padding: 8px;
    color: #888;
    font-size: 13px;
    text-align: center;
}

.settings-panel {
    padding: 20px;
}

.settings-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: #4a76a8;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.save-btn {
    background: #4a76a8;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    flex: 1;
}

.cancel-btn {
    background: #f1f1f1;
    color: #333;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    flex: 1;
}